package cn.swu.lzr.event;

import cn.swu.lzr.JDBC.DBTools;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public class DeleteEventServlet extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    {

        int id = Integer.valueOf(request.getParameter("eventId"));
        try {
            DBTools dbTools = new DBTools();
            dbTools.DeleteById(id);
            response.sendRedirect("/java-design/index.html");
        }catch (Exception e){
            e.printStackTrace();
        }
    }

}
